package classes
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.events.Event.COMPLETE;
	/**
	 * ...
	 * @author ...
	 */
	public class GameXMLLoader  
	{
		private var xmlLoader:URLLoader; 
		private var loadedXMLObjects:Array = new Array();
		
		public function GameXMLLoader():void 
		{
			
		}
		
		public static function loadXMLDocument(documentName:String, pathToDocument:String):Boolean
		{
			try
			{
				this.xmlLoader = new URLLoader();
				this.addEventListeners(this.xmlLoader);
			}
			catch (error:Error)
			{
				removeEventListeners(this.xmlLoader);
				throw new GameXMLLoaderError('failed loading xml document: ' + pathToDocument, 0);
			}
		}
		
		private function addEventListeners( xmlLoader:URLLoader)
		{
			xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
		}
		
		private function removeEventListeners(xmlLoader:URLLoader)
		{
			xmlLoader.removeEventListener(Event.COMPLETE, xmlLoaded);
		}
		
		private function xmlLoaded(e:Event):void 
		{
			var xml:XML = new XML(e.target.data);
			this.loadedXMLObjects[name] = 
		}
		

	}
	
}